home *** CD-ROM | disk | FTP | other *** search
- /*
- Visual FX
- For
- Image FX
- SetUp Script
- Written By J.L. White
-
- (C)1997 Merlin's Software
-
- */
- Quote = '22'X
- parse arg Num Frames
- options results
- address "IMAGEFX.1"
- ReDraw On
- RequestResponse "Do You Need Instructions?"
- if rc = 0 then do
- call Docs()
- end
-
- if exists("libs:flyer.library") then do
- if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
- RequestNotify 'Flyer Must Be Running First!'
- exit
- end
- call OpenFlyStuff()
-
-
- Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
- ComplexRequest '"Visual FX SetUp Options"' 1 Gadget 250 60
- if rc ~= 0 then do
- call CloseStuff()
- exit 0
- end
- else do
- IAType = RESULT.1
- end
-
- call GetA()
- end
- else do
- Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
- ComplexRequest '"Visual FX SetUp Options"' 1 Gadget 250 60
- if rc ~= 0 then do
- call CloseStuff()
- exit 0
- end
- else do
- IAType = RESULT.1+2
- end
-
- call GetA()
- end
- KillBrush
- i = Start
- call LoadA()
- GetMain
- parse var result Name Width Height Blah
-
- RequestNumber '"Enter Number Of Flares To Process!"' 1
- FlareNum = result
-
- do FNum = 1 to FlareNum
- Title = Quote"Enter Size Of Lens Flare #"FNum""Quote
- RequestSlider Title 1 200 50
- Answer2.FNum = Result
-
- Gadget.1 = ' Select Path Options For #'FNum
- Gadget.2 = ' Draw Straight Line '
- Gadget.3 = ' Draw Free Hand Line '
- ListRequest 3 Gadget
- PathType.FNum = 0
- if result = 2 then PathType.FNum = 0
- if result = 3 then PathType.FNum = 1
- if PathType.FNum = 0 then call PickLine()
- if PathType.FNum = 1 then call PickFreeLine()
-
-
- Gadget.1 = ' Select Lens Flare Options For #'FNum
- Gadget.2 = ' Use Default Lens Flare '
- Gadget.3 = ' User Defined Lens Flare '
- Gadget.4 = ' User Defined Radial Star '
- ListRequest 4 Gadget
- LensType.FNum = 0
- if result = 2 then LensType.FNum = "Hook LensFlare Standard 0 50 255 252 82 225 25 0 255 255"
- if result = 3 then do
- Learn "RAM:LensType" NoHeader Quiet Force
- Hook LensFlare
- Learn Stop Quiet Force
- call open TempFile,"Ram:LensType.ifx",R
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- LensType.FNum = readln(TempFile)
- call close TempFile
- end
- if result = 4 then do
- Learn "RAM:LensType" NoHeader Quiet Force
- Hook RadialStar
- Learn Stop Quiet Force
- call open TempFile,"Ram:LensType.ifx",R
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- LensType.FNum = readln(TempFile)
- call close TempFile
- end
- end
- if FlyOn = 1 then
- call CloseStuff()
-
- call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
- call writeln TempFile,PicAName
- call writeln TempFile,Start
- call writeln TempFile,End
- call writeln TempFile,IAType
- call writeln TempFile,FlareNum
- do FNum = 1 to FlareNum
- call writeln TempFile,Answer.FNum
- call writeln TempFile,Answer2.FNum
- call writeln TempFile,PathType.FNum
- call writeln TempFile,LensType.FNum
- end
- call close TempFile
- exit
-
- GetFile:
- parse Arg Title, Path
- Address FLY_1 SetString Path
- Address FLY_1 GetFileNameNT Title
- return result
-
- GetFileName: procedure
- ARG CompleteName
- c = lastpos("/",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return substr(CompleteName, c + 1)
-
-
- GetA:
- if IAType = 0 then do
- call Switcher(TOSW)
- PicAName = GetFile("Select Flyer Clip For ImageA! ",DriveName)
- Name = GetFileName(PicAName)
- if Name = "" then do
- Address FLY_1 OK_TEXT " OK "
- Title = "You Must Enter A Valid Clip Name To Use!"
- Address FLY_1 FYINT Title
- Address FLY_1 Quit
- call Switcher(TOWB)
- exit
- end
- Address FLY_1 SetFileName PicAName
- Address FLY_1 GetClipLength PicAName
- End = result
- Start = 0
- Address FLY_1 Program "5"
- Address FLY_1 StartNum Start
- Address FLY_1 EndNum End
- Address FLY_1 CurrentNum "0"
- Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
- Start = word(result,1)*2
- End = word(result,2)*2
- Start = Start + 1
- End = End +2
- call addlib('PROJECT_REXX_PORT' , 0)
- call addlib(TOASTERLIB,0)
- call Switcher(TOWB)
- address command "C:Wait 1"
- ScreenToFront
- end
- if IAType = 1 then do
- RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
- PicAName = result
- Name = GetFileName(PicAName)
- if Name = "" then do
- Title = "You Must Enter A Valid Name To Use!"
- RequestNotify Title
- if FlyOn = 1 then Address FLY_1 Quit
- exit
- end
- RequestNumber '"Enter Number Of Frames To Process!"' Frames
- End = result
- Start = 1
- end
- if IAType = 2 then do
- RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
- PicAName = result
- Name = GetFileName(PicAName)
- if Name = "" then do
- Title = "You Must Enter A Valid Name To Use!"
- RequestNotify Title
- if FlyOn = 1 then Address FLY_1 Quit
- exit
- end
- RequestNumber '"Enter Number Of Frames To Process!"' Frames
- End = result
- Start = 1
- end
- if IAType = 3 then do
- RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
- PicAName = result
- Name = GetFileName(PicAName)
- if Name = "" then do
- Title = "You Must Enter A Valid Name To Use!"
- RequestNotify Title
- if FlyOn = 1 then Address FLY_1 Quit
- exit
- end
- RequestNumber '"Enter Number Of Frames To Process!"' Frames
- End = result
- Start = 1
- end
- return
-
- CloseStuff:
- Address FLY_1 Quit
- call remlib('ToasterARexx.port')
- call remlib('PROJECT_REXX_PORT')
- return
-
-
- OpenFlyStuff:
- FlyOn = 1
- address command "run VFXIFX:FLY"
- do while (POS('FLY_1',SHOW('Ports')) = 0)
- address command "wait 1"
- end
- TOASTERLIB="ToasterARexx.port"
- call remlib('ToasterARexx.port')
- call remlib('PROJECT_REXX_PORT')
- call addlib('PROJECT_REXX_PORT' , 0)
- call addlib(TOASTERLIB,0)
- DriveName = FindDrive()
- return
-
-
- FindDrive:
- address command "C:Info >RAM:DriveList"
- call open TempFile,"RAM:DriveList",R
- do until eof(TempFile)
- line = readln(TempFile)
- parse var line Drive" "Rest
- if Drive = "FA0:" then
- FlyVolume = word(Rest,7)":"
- end
- call close TempFile
- address command "Delete >NIL: RAM:DriveList"
- return FlyVolume
-
-
- PickLine:
- KillBrush
- Menu ToolBox
- DrawTool "Line"
- RequestNotify "Draw Line From Point A To Point B For Movement Of Lens Flare #"FNum
- HidePanel
- Undo On
- WaitFor SELECTDOWN
- parse var result X1 Y1
- WaitFor SELECTUP
- parse var result X2 Y2
- Undo
- ShowPanel
- Undo Off
- GetMain
- parse var result Name Width Height Blah
- if X1 < 10 then X1 = -50
- if Y1 < 10 then Y1 = -10
- if X2 > (Width-10) then X2 = Width+100
- if Y2 > (Height-10) then Y2 = Width+10
- X1 = strip(X1)
- Y1 = strip(Y1)
- X2 = strip(X2)
- Y2 = strip(Y2)
- Answer.FNum = X1" "Y1" "X2" "Y2
- RequestResponse "Is The Line You Have Drawn Correct?"
- if rc ~= 0 then call PickLine()
-
- return
-
- PickFreeLine:
- KillBrush
- Menu ToolBox
- DrawTool "FreeDraw"
- RequestNotify "Draw Line For Movement Of Lens Flare #"FNum
- HidePanel
- Undo On
- WaitFor SELECTDOWN
- Learn "RAM:FreeDraw" NoHeader Quiet Force
- WaitFor SELECTUP
- Learn Stop Quiet Force
- Undo
- ShowPanel
- Undo Off
- RequestResponse "Is The Line You Have Drawn Correct?"
- if rc ~= 0 then call PickFreeLine()
- CountNum = 0
- call open TempFile,"Ram:FreeDraw.ifx",R
- call open TempFile2,"VFXIFX:TempDrawer/DrawNum."left(Num,2,'')"."right(FNum,2,'0'),W
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- line = readln(TempFile)
- do until eof(TempFile)
- DoIt = readln(TempFile)
- if DoIt = "FreeDraw" then leave
- parse var DoIt Name" "Nums
- call writeln TempFile2,Nums
- CountNum = CountNum + 1
- end
- call close TempFile
- call close TempFile2
- Answer.FNum = right(CountNum,3,'0')
- address command "Delete >NIL: RAM:FreeDraw.ifx"
- return
-
- LoadA:
- if IAType = 0 then do
- LoadBuffer PicAName Force i
- end
- if IAType = 1 then do
- LoadBuffer PicAName Force 1
- end
- if IAType = 2 then do
- LoadBuffer PicAName Force
- end
- if IAType = 3 then do
- LoadBuffer PicAName""right(i,3,'0') Force
- end
- return
-
-
- Docs:
-
- text1 = '"This effect will create a Lens Flare, then move it"'
- text2 = '"across the top of the image from Point-A to Point-B."'
- text3 = '"You can also define your own path to follow. It will"'
- text4 = '"ask for the size and path of the Flare. Then you have"'
- text5 = '"the option to select our default settings or bring up"'
- text6 = '"the Lens Flare panel & customize it the way you like."'
-
- Gadget.1 = 'TEXT LE=10 TE=4 LB='text1' '
- Gadget.2 = 'TEXT LE=10 TE=14 LB='text2' '
- Gadget.3 = 'TEXT LE=10 TE=24 LB='text3' '
- Gadget.4 = 'TEXT LE=10 TE=34 LB='text4' '
- Gadget.5 = 'TEXT LE=10 TE=44 LB='text5' '
- Gadget.6 = 'TEXT LE=10 TE=54 LB='text6' '
- Gadget.7= 'END'
- NewComplexRequest '"Instructions For Effect #11"' Gadget 386 66
-
- return
-
-
-